const webpack = require('webpack')

module.exports = {

    publicPath: './',
    assetsDir: 'static',
    productionSourceMap: false,
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    },
    devServer: {
        host: 'localhost',
        port: 9322,
        // - `proxy`：配置代理，解决前端开发过程中跨域请求的问题。这里设置了当请求以`/api`开头时，转发到`http://localhost:9321`，并进行路径重写
        proxy: {
            '/api':{
                target:'http://localhost:9321',
                changeOrigin:true,
                pathRewrite:{
                    '^/api':''
                }
            }
        }
    }
};